From: Alessandro Bono Date: Fri, 20 Oct 2023 20:00:40 +0000 (+0200) Subject: animationUtils: Allow marking animations as required X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~204^2^2~14 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=27878aa0965f2dfc503bac4e0a12a8a2fac3e548;p=gnome-shell.git animationUtils: Allow marking animations as required There are cases when we want to mark an animation as required. For example, we want the "Locate Pointer" animation to work even when the animation is marked as disabled. Take this into account when adjusting the animation time. Part-of: --- diff --git a/js/misc/animationUtils.js b/js/misc/animationUtils.js index a7a0ea8b0..cf6889609 100644 --- a/js/misc/animationUtils.js +++ b/js/misc/animationUtils.js @@ -13,14 +13,20 @@ const N_WIGGLES = 3; * adjustAnimationTime: * * @param {number} msecs - time in milliseconds + * @param {object} params - optional parameters + * @param {boolean=} params.animationRequired - whether to ignore the enable-animations setting * * Adjust `msecs` to account for St's enable-animations * and slow-down-factor settings */ -export function adjustAnimationTime(msecs) { +export function adjustAnimationTime(msecs, params) { + params = Params.parse(params, { + animationRequired: false, + }); + const settings = St.Settings.get(); - if (!settings.enable_animations) + if (!settings.enable_animations && !params.animationRequired) return 0; return settings.slow_down_factor * msecs; }